feat(mcp): add privacy-safe recall receipts#1031
Conversation
ishaanxgupta
left a comment
There was a problem hiding this comment.
I don't think plain deterministic sha256 prefixes are enough to call this privacy-safe. Query text, project/container tags, memory IDs, and especially short memory content can be dictionary-guessed offline, and the same private value is linkable across receipts forever.
Plain deterministic sha256 prefixes over low-entropy values (query, container tags, memory ids, short content) are dictionary-guessable offline and link the same value across receipts forever. Key an HMAC with a per-receipt random salt that is never emitted, so tokens cannot be precomputed or correlated across receipts while equality is still preserved within a single receipt for debugging.
|
Good catch, you're right that a plain deterministic SHA-256 prefix isn't privacy-safe for these inputs. I've reworked the hashing in
|
Summary
Adds an optional
includeReceiptflag to the MCPrecalltool. When enabled, recall responses include a privacy-safe retrieval receipt instructuredContent.receipt.The receipt helps users and maintainers debug cross-client memory retrieval without exposing raw memory text, raw queries, project names, transcripts, or private repository content.
Closes #985.
What changed
includeReceiptto the MCP recall schema.createRetrievalReceipt()helper.Validation
bunx biome check --write apps/mcp/src/server.ts apps/mcp/src/retrieval-receipt.ts apps/mcp/src/retrieval-receipt.test.tsbunx vitest run src/retrieval-receipt.test.tsbun run --cwd apps/mcp build:uibun run check-typescurrently fails on existing unrelated@supermemory/toolstype errors.